//
//  LCLoginViewController.m
//  ZhuCeDenglu
//
//  Created by 吕超 on 16/5/17.
//  Copyright © 2016年 lc. All rights reserved.
//

#import "LCLoginViewController.h"
#import "LCRegisterViewController.h"
#import "LCMyTableViewController.h"
@interface LCLoginViewController ()<UITextFieldDelegate>

@end

@implementation LCLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    //修改navgation上按钮颜色
    self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:1/255.0 green:164/255.0 blue:182/255.0 alpha:1];
    
    //textFiled去掉边框  加背景色
     [_LoginName setBorderStyle:UITextBorderStyleNone];
    _LoginName.backgroundColor = [UIColor whiteColor];
    
    [_LoginPassword setBorderStyle:UITextBorderStyleNone];
    _LoginPassword.backgroundColor = [UIColor whiteColor];
    
    

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"注册" style:(UIBarButtonItemStylePlain) target:self action:@selector(registerButton)];

    self.navigationItem.title = @"请登录";
}


- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    //状态栏设成黑色
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
}



//注册按钮
- (void)registerButton{
    LCRegisterViewController *registerVC = [[LCRegisterViewController alloc]init];
    
    __weak LCLoginViewController *WeakSelf = self;
    
    registerVC.blockString = ^(NSString *Name , NSString *Password){
        WeakSelf.LoginName.text = Name;
        WeakSelf.LoginPassword.text = Password;
    };
    
    [self.navigationController pushViewController:registerVC animated:YES];
}


//登录按钮
- (IBAction)LginButton:(id)sender {
    
    LCMyTableViewController *myTVC = [[LCMyTableViewController alloc]init];
    
    // 设置模态样式
    myTVC.modalPresentationStyle = UIModalPresentationFullScreen;
    // 设置模态的动画效果
    myTVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

        [self presentViewController:myTVC animated:YES completion:nil];
}




// 删除所有第一响应者  取消键盘
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}





@end
